import {fileURLToPath, URL} from 'node:url'
import {defineConfig} from 'vite'
import vue from '@vitejs/plugin-vue'


// https://vite.dev/config/
export default defineConfig({
    plugins: [vue()],
  resolve: {
    alias: {
      '@': fileURLToPath(new URL('./src', import.meta.url)),
      '@components': fileURLToPath(new URL('./src/components', import.meta.url)),
      '@assets': fileURLToPath(new URL('./src/assets', import.meta.url)),
    }
  },
  server: {
    host: "localhost",
    port: 5173,
    open: true,
    // proxy: {
    //   "^/api": {
    //     target: "http://127.0.0.1:8099", // 后端服务实际地址
    //     changeOrigin: true, //开启代理
    //     ws: true,
    //     rewrite: (path) => path.replace(/^\/api/, ""),
    //   },
    // },
  }
})
